//package ai;
//
//import misc.Debug;
//import engine.data.City;
//import engine.data.Unit;
//import engine.data.UnitType;
//
//public class PossibleProduction implements Lo {
//
//	// private static final short DISTANCE_MAX = 10;
//
//	public Task task;
//	public Unit possibleTaskDoer;
//	public City possibleCityDoer;
//	public short distance;
//	public short score;
//
//	public PossibleProduction(City possibleCityDoer, Task task, Unit unit) {
//		this.possibleTaskDoer = unit;
//		this.task = task;
//		this.possibleCityDoer = possibleCityDoer;
//		setDistance();
//		setScore();
//	}
//
//	private void setScore() {
//		if (UnitType.getMP(possibleCityDoer.type) == 0)
//			Debug.logConsole("Warning : UnitType.getMP is 0 "
//					+ possibleTaskDoer);
//		this.score = (short) FuzzyEngineFactory.getResAllocFuzzyEngine()
//				.defuzzify(
//						possibleCityDoer.getFormula(unit),
//						(short) (this.distance / UnitType
//								.getMP(possibleCityDoer.type)));
//	}
//
//	private void setDistance() {
//		distance = (short) (Math.abs(PathFinding.getHeuristic(
//				possibleCityDoer.x, possibleCityDoer.y, unit.getX(), unit
//						.getY())));
//	}
//
//	public boolean leq(Object compareTo) {
//		return this.score >= ((PossibleProduction) compareTo).score;
//	}
//
//	public String toString() {
//		// TODO Auto-generated method stub
//		return new StringBuffer("- score ").append(score).append("=priority ")
//				.append(task.getFormula(possibleTaskDoer)).append(" distance ")
//				.append(this.distance).append(" : (").append(task.id).append(
//						") ").append(task.name).append(" ").append(
//						task.getTargetToString()).append(" possibleTaskDoer ")
//				.append(possibleTaskDoer.toStringShort()).append("\n")
//				.toString();
//	}
//
//}
